<%@ page language="java" contentType="text/html; charset=utf-8"  pageEncoding="utf-8"%>
<%@page import="it.polimi.travelDream.ejb.servlet.*" %>
<%@page import="it.polimi.travelDream.entities.*" %>
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>
		  	TravelDreamLogin
		</title>
		<link rel="stylesheet" type="text/css" href="style.css" />
  	</head>
  
  
  <body>
  	<div class="header">
  		 <ul>
  			<li>TravelDream</li>
		    Manage Basic Products
	    </ul>
  	</div> 	
  	
  	<div class="section">	    
	    <div class="nav">
	    	<ul> 
	    		<li> <a href="StaffHome.jsp">Home</a></li>
	    		<li class="cur"> <a href="BPManagement.jsp"> Manage BasicProducts</a></li>
	    			<ul class="subnav">
						<li class="cur">Add Transportation &rarr; </li>
						<li><a href="BPAddHotel.jsp">Add Hotel</a></li>
						<li><a href="BPAddExcursion.jsp">Add Excursion</a></li>
						<li><a href="BPEditTravel.jsp">Edit Transportation</a></li>
						<li><a href="BPEditHotel.jsp">Edit Hotel</a></li>
						<li><a href="BPEditExcursion.jsp">Edit Excursion</a></li>
					</ul>
	    		<li> <a href="PManagement.jsp"> Manage Packages</a></li>
	    		<% 
	    		Staff z = new Staff(0,false,"0","0","0","0","0");
	      		if (request.getSession().getAttribute("utente")!=null )
		    	{ 
	      			z=(Staff)request.getSession().getAttribute("utente");
		        }
	      		else
	      		{
	      			
	      		}
	    		if (z.isPermission())
	    		{
	    			out.println("<li><a href=StaffRegistration.jsp> Manage Staff </a></li>");
	    		}
		    	
	    
		    		%>
	    		<li> <a href="/TravelDreamSystemWeb/StaffLogoutServlet?session=0"> Logout </a></li>
	    	</ul>
	    </div>
	    <div class="content">
 <% 
	      if (request.getSession().getAttribute("utente")!=null )
		    	{ Staff u=(Staff)request.getSession().getAttribute("utente");
		    		System.out.println("ciao"+u.getId());
		    	
	    
		    		%>
			<form action="AddTransportation" method="POST" id=form class=myform>
	    			<div class="spacer"></div>
	    			<fieldset>
	  					<legend>Add a New Transport:</legend>
	  						
	  						<div class="spacer"></div>
	  						
	  						<label>Type
								<span class="small">Type of transportation</span>
							</label>
							<input class="in" type="text" name="typeTransportation" value="Flight" readonly="readonly"   />
							
							<label>Departure
								<span class="small">Departure airport</span>
							</label>
							<input class="in" type="text" name="departureFrom"  />
							
							
							<label>Arrival
								<span class="small">Arrival airport</span>
							</label>
							<input class="in" type="text" name="goingTo" />
							
							<label>Departure date
								<span class="small">Departure date [local time]</span>
							</label>
							<input class="in" type="text" name="outBound" />
							
							<label>Arrival date
								<span class="small">Arrival date [local time]</span>
							</label>
							<input class="in" type="text" name="inBound"  />
							
							<label>Cost
								<span class="small">Total Cost &euro;</span>
							</label>
					   		<input class="in" type="text" name="cost"  />				 				
					    	 
					    	 
					    	<input class="button" type="submit" value="Add" />
				    </fieldset>
			    
	    	</form>
	    	
    			   <% 
	    	if (request.getAttribute("message") == null) 
		    	{ 
		    		%>
						<div></div>
					<% 
				} 
	    	else 
		    	{ 
		    		%>
						<div class="advice"><%=request.getAttribute("message")%></div>
					<% 
				} 
		%>

    </div>
		<%
		} else { 
				response.sendRedirect("/TravelDreamSystemWeb/StaffLogin.jsp");
				%>
				
				
					<%
		}	
		%>
		
		</div>

    
    <div class="footer">
    	<ul>
	    	<li>TravelDream Company srl © All rights reserved</li>
		    <li>Terms of use | Contacts | Team </li>
	    </ul>
    </div>  
    
  </body>
</html>